<?php
$num = $_REQUEST['num'];
$num = $num*8;
$con = mysqli_connect('localhost', 'root', '', 'friday');
 mysqli_set_charset($con, 'utf8');
 if(preg_match("/[^\d-., ]/",$num)){
 	
 }else{
 	 $sql = "select * from fruit limit $num,8";
 $result = mysqli_query($con, $sql);
 $arr = mysqli_fetch_all($result,MYSQLI_ASSOC);
 $str = json_encode($arr);
 echo  $str;
 }
?>